/**
 * @author mili
 */

var incidents, incidentsArray, heatmap, map;

function insertIncidents(data){
	incidents.push(data);
}

function changeGradient(){
	var gradient = [
          'rgba(0, 255, 255, 0)',
          'rgba(0, 255, 255, 1)',
          'rgba(0, 191, 255, 1)',
          'rgba(0, 127, 255, 1)',
          'rgba(0, 63, 255, 1)',
          'rgba(0, 0, 255, 1)',
          'rgba(0, 0, 223, 1)',
          'rgba(0, 0, 191, 1)',
          'rgba(0, 0, 159, 1)',
          'rgba(0, 0, 127, 1)',
          'rgba(63, 0, 91, 1)',
          'rgba(127, 0, 63, 1)',
          'rgba(191, 0, 31, 1)',
          'rgba(255, 0, 0, 1)'
        ]
}

function init(){
	var mapOptions = {
		zoom: 13,
		center: new google.maps.LatLng(37.774546, -122.433523),
        mapTypeId: google.maps.MapTypeId.SATELLITE
	};
	
	map = new google.maps.Map(document.getElementById('map_canvas'),
            mapOptions);

    incidentsArray = new google.maps.MVCArray(incidents);

    heatmap = new google.maps.visualization.HeatmapLayer({
      	data: pointArray
    });

	heatmap.setMap(map);
}

function toggleHeatmap(){
	heatmap.setMap(heatmap.getMap() ? null : map);
}

function changeRadius(){
	
}
